<?php
    include_once 'connection/databaseHandler.php';
    include_once 'connection/sessionHandler.php';
    $database = new DatabaseHandler();
    $session = new SessionHandler();
    
    include_once 'classes/cHome.php';
    $thisPage = new Home($database,$session);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Home</title>
        <link href="style/style_general.css" rel="stylesheet" type="text/css"/>

        <link href="style/style_home.css" rel="stylesheet" type="text/css"/>
        <link href="style/style_chat.css" rel="stylesheet" type="text/css"/>
        <link href="style/style_notif.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="script/AJAX.js"></script>
        <script type="text/javascript" src="script/notif.js"></script>
        <script type="text/javascript" src="script/chat.js"></script>
    </head>
    <body>
        <?php
            if ($session->isLoggedIn) {
                echo "<script language=javascript>initChat()</script>";
                echo "<script language=javascript>initNotif()</script>";
            }
            include 'layout/general_layout/header.php';
            $thisPage->genHeader();
            include 'layout/home_layout/home_search.php';
            if (isset($_GET['p']) && isset($_GET['q'])) {
                $thisPage->genContent($_GET['p'],$_GET['q']);
            }
            else {
                $thisPage->genContent(NULL,NULL);
            }
            include 'layout/general_layout/footer.php';
        ?>
    </body>
</html>
<!--$url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];-->